import React, { Component } from 'react'
import './pagination.less'
export default class Pagination extends Component{
    clickdot=(cs)=>{
        this.props.getindex(cs)
    }
    render(){
        return(
            <div className='pagination'>
                {new Array(this.props.num).fill(1).map((ele,index)=>{
                    return  <div 
                                
                                className={
                                    index===this.props.curindex
                                    ?
                                    'dot active'
                                    :
                                    'dot'
                                } 
                                onClick={this.clickdot.bind(this,index)}
                                key={index}
                                >
                                </div>
                })}
            </div>
        )
    }
}